//导入express模块
const express = require('express')

//创建express的服务器实例
const app = express();

const cors = require('cors');

app.use(cors());

app.use(express.urlencoded({ extended: false }))

// write your code here...
// 导入路由模块
const router = require('./16.apiRouter');

// 将路由模块注册到app上
app.use('/api', router);

//调用app.listen方法，指定端口号并启动web服务器
app.listen(80, () => {
    console.log('http://127.0.0.1');
})